CC = g++
LIB = -L../lib 
INCLUDE = -I../include -I../base

#CFLAG = -DLOG_LEVEL_LITE -DDEF_BYTE_PARSER -g -c
CFLAG = -DLINUX -DLOG_LEVEL_LITE -DDEBUG -g -c
#PROFILE = -pg
PROFILE = 
OPTIMIZE =
WARNNING = -w
LINKLIB = -ltiny -lpthread
TARGET = ../lib/libnetwork.a
OBJECTS = EPoll_IOListener.o NetParser.o NetLibs.o NetService.o SessionSync.o SELECT_IOListener.o NetworkSession.o NetInstanceBuilder.o NetServiceOrder.o

${TARGET} : ${OBJECTS}
	ar r ${TARGET} NetParser.o
	ar r ${TARGET} NetworkSession.o
	ar r ${TARGET} SELECT_IOListener.o
	ar r ${TARGET} EPoll_IOListener.o
	ar r ${TARGET} NetService.o
	ar r ${TARGET} SessionSync.o
	ar r ${TARGET} NetInstanceBuilder.o
	ar r ${TARGET} NetLibs.o
	ar r ${TARGET} NetServiceOrder.o
	ar s ${TARGET}
	ar t ${TARGET}

NetLibs.o : NetLibs.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp

NetServiceOrder.o : NetServiceOrder.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp

SELECT_IOListener.o : SELECT_IOListener.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp

NetParser.o : NetParser.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp

EPoll_IOListener.o : EPoll_IOListener.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp

NetService.o : NetService.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp

NetworkSession.o : NetworkSession.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp
	
SessionSync.o : SessionSync.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp
	
NetInstanceBuilder.o : NetInstanceBuilder.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp

clean :
	rm -rf *.o *.a

new:
	${MAKE} clean
	${MAKE}
